package com.supercube.sport.yoga.service.impl;

import com.supercube.sport.yoga.dao.SiteInfoMapper;
import com.supercube.sport.yoga.domain.SiteInfoDTO;
import com.supercube.sport.yoga.service.SiteInfoService;
import com.supercube.sport.yoga.vo.SiteInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SiteInfoServiceImpl implements SiteInfoService {

    @Autowired
    private SiteInfoMapper siteInfoMapper;

    @Override
    public int save(SiteInfoDTO dto) {
        return siteInfoMapper.insert(dto);
    }

    @Override
    public List<SiteInfoVO> querySiteInfoByVenueId(String venueId, String usePurpose) {
        return siteInfoMapper.selectSiteInfoByVenueId(venueId, usePurpose);
    }

    @Override
    public int update(SiteInfoDTO dto) {
        return siteInfoMapper.updateByPrimaryKey(dto);
    }

    @Override
    public int deleteVenueInfoById(String id) {
        return siteInfoMapper.deleteByPrimaryKey(id);
    }

    @Override
    public SiteInfoVO querySiteInfoById(String id) {
        return siteInfoMapper.selectByPrimaryKey(id);
    }
}
